
// @ts-nocheck
/**
 * 自定义封装支付函数
 */
export function pay(res, successData, errorData) {
	console.log(res.data, '参数')
	uni.requestPayment({
		"timeStamp": res.data.timeStamp,
		"nonceStr": res.data.nonceStr,
		"package": res.data.packageValue,
		
		"signType": res.data.signType,
		"paySign": res.data.paySign,
		"success": function(res) {
			uni.showToast({
				title: '支付完成',
				icon: "success",
				duration: 1500,
				success: function(data) {
					successData(data)
				}
			})
		},
		"fail": function(res) {
			if (errorData) {
				errorData(res)
			}
			uni.showToast({
				title: '已取消支付',
				icon: "none",
				duration: 1500,
			})
		}
	})
}
